#ifndef XSHIFTSETTING_H
#define XSHIFTSETTING_H

#include <QDialog>
#include "qcustomplot/qcustomplot.h"

namespace Ui {
class XShiftSetting;
}

struct XShift {
    bool valid{false};
    double start{0};
    double length{0};
    double factor{0.005};
    double originLen{0};
};

class XShiftSetting : public QDialog
{
    Q_OBJECT

public:
    explicit XShiftSetting(QWidget *parent = nullptr);
    ~XShiftSetting();
    QPair<double, double> getOption();
    void setOption(const XShift &shift, QCustomPlot *plotLma, QCustomPlot *plotLf);
    static void shiftData(QCustomPlot *plotLma, QCustomPlot *plotLf, double start, double factor);

private slots:
    void on_btnDefault_clicked();

private:
    Ui::XShiftSetting *ui;
    QCustomPlot *mPlotLma;
    QCustomPlot *mPlotLf;
    double mOriginLen;
};

#endif // XSHIFTSETTING_H
